<%@page import="cn.mvcjava.model.User"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style>
tr{
 height: 40px;
}
td{
width:80px;
text-align: center;
}
</style>
</head>
<body>
  <form action="<%= request.getContextPath()%>/query.udo"  >
   	  <table style="margin: 20px;padding: 50px;border: 1px solid #000000;">
	      <tr>
	          <td style="text-align: left;">用户名：</td>
	          <td style="text-align: right;"><input type="text" name="username"  /></td>
	      </tr>
          <tr>
	          <td style="text-align: left;">密码：</td>
	          <td style="text-align: right;"><input type="text" name="password"  /></td>
	      </tr>
	      <tr>
	          <td style="text-align: left;">地址：</td>
	          <td><input type="text" name="adress"  /></td>
	      </tr>
	       <tr>
	          <td style="text-align: left;">手机号：</td>
	          <td style="text-align: right;"><input type="text" name="phone"  /></td>
	      </tr>
	         <tr>  
	          <td colspan="2" style="text-align: right;"><input type="submit"  value="提交表单"  /><br/>
	                       <a href="<%= request.getContextPath() %>/add.jsp">注册新用户</a>
	          </td>
	      </tr>
      </table>
       </form>
      
      
        <table style="margin: 10px;padding: 20px;" border="1" cellpadding="0" cellspacing="0">
	       <tr>
      		 	<td>id</td>
       			<td>用户名</td>
       			<td>密码</td>
       			<td>手机号</td>
       			<td>地址</td>
       			<td>时间</td>
       			<td>操作</td>
	       </tr>
	       <% 
	          List<User> list = (List<User>)request.getAttribute("userlist"); 
 			if(list!=null && list.size()>0){
 			for(User user:list){
 		
	       %>
	        <tr>
      		 	<td><%=user.getId() %></td>
       			<td><%=user.getUsername() %></td>
       			<td><%=user.getPassword() %></td>
       			<td><%=user.getPhone() %></td>
       			<td><%=user.getId() %></td>
       			<td><%=user.getId() %></td>
       			<td><a href="<%= request.getContextPath() %>/update.udo?id=<%=user.getId() %>">编辑</a> | <a href="<%= request.getContextPath() %>/delete.udo?id=<%=user.getId() %>">删除</a></td>
	       </tr>
	      <%
 			  }  
 		   }
	      %> 
	       
	       
      </table>
 
</body>
</html>